﻿using System.Diagnostics;
using System.Runtime.Serialization;

namespace StreetPacMan.Server.Facade
{
    [DataContract]
    public class Geo
    {
        private readonly string _OptionalName;
        private readonly string _Description;

        [DebuggerNonUserCode]
        public Geo(string optionalName, double lat, double lon)
            : this(lat, lon)
        {
            _OptionalName = optionalName;
            _Description = _OptionalName + string.Format(" ({0}, {1})", Lat, Lon);
        }

        [DebuggerNonUserCode]
        public Geo(double lat, double lon)
        {
            Lat = lat;
            Lon = lon;
            _Description = string.Format("({0}, {1})", Lat, Lon);
        }

        [DataMember]
        public double Lat { get; private set; }
        [DataMember]
        public double Lon { get; private set; }

        public override string ToString()
        {
            return _Description;
        }
    }
}